﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional

namespace SBlogCore.EntityFrameworkContext.Migrations
{
    /// <inheritdoc />
    public partial class v10 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "CustomerInfo",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID"),
                    CustomerCode = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "用户编码"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "名称"),
                    Age = table.Column<int>(type: "int", nullable: false, comment: "年龄"),
                    Sex = table.Column<int>(type: "int", nullable: false, comment: "性别"),
                    Birthday = table.Column<int>(type: "int", nullable: false, comment: "生日"),
                    Phone = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "主手机号"),
                    Phone1 = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "备用手机号1"),
                    Phone2 = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "备用手机号2"),
                    Industry = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "客户行业"),
                    Introducer = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "介绍人"),
                    SysOrgId = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
                    PlantId = table.Column<long>(type: "bigint", nullable: true, comment: "子公司ID"),
                    OldId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老系统ID"),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "租户Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CustomerInfo", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SysFileInfo",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID"),
                    FileLocation = table.Column<int>(type: "int", nullable: false, comment: "文件存储位置（1:阿里云，2:腾讯云，3:minio，4:本地）"),
                    FileBucket = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "文件仓库"),
                    FileOriginName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "文件名称（上传时候的文件名）"),
                    FileType = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "文件类型"),
                    FileSuffix = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "文件后缀"),
                    FileSizeKb = table.Column<long>(type: "bigint", nullable: false, comment: "文件大小kb"),
                    FileSizeInfo = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "文件大小信息，计算后的"),
                    FileObjectName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "存储到bucket的名称（文件唯一标识id）"),
                    FilePath = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "存储路径"),
                    SysOrgId = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
                    PlantId = table.Column<long>(type: "bigint", nullable: true, comment: "子公司ID"),
                    OldId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老系统ID"),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "租户Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysFileInfo", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SysLogging",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Message = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MessageTemplate = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Level = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    TimeStamp = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Exception = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Properties = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysLogging", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SysMenu",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID"),
                    Redirect = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "定向地址"),
                    Path = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "路径"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "名称"),
                    Component = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "源文件地址"),
                    Level = table.Column<int>(type: "int", nullable: false, comment: "层级"),
                    Title = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "标题"),
                    Icon = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "图标"),
                    Order = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    Hidden = table.Column<bool>(type: "bit", nullable: true, comment: "是否隐藏"),
                    AlwaysShow = table.Column<bool>(type: "bit", nullable: true, comment: "是否在左侧显示"),
                    NoCache = table.Column<bool>(type: "bit", nullable: true, comment: "keep-alive缓存"),
                    Breadcrumb = table.Column<bool>(type: "bit", nullable: true, comment: "是否在面包屑中显示"),
                    Affix = table.Column<bool>(type: "bit", nullable: true, comment: "是否固定在Tag上"),
                    NoTagsView = table.Column<bool>(type: "bit", nullable: true, comment: "是否不在Tag中显示"),
                    ActiveMenu = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "显示高亮的路由路径"),
                    FollowAuth = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "跟随那个路由进行权限过滤"),
                    CanTo = table.Column<bool>(type: "bit", nullable: true, comment: "是否允许跳转"),
                    IsParent = table.Column<bool>(type: "bit", nullable: true, comment: "是否为父级"),
                    ParentInfoId = table.Column<long>(type: "bigint", nullable: true, comment: "父级"),
                    SysOrgId = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
                    PlantId = table.Column<long>(type: "bigint", nullable: true, comment: "子公司ID"),
                    OldId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老系统ID"),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "租户Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysMenu", x => x.Id);
                    table.ForeignKey(
                        name: "FK_SysMenu_SysMenu_ParentInfoId",
                        column: x => x.ParentInfoId,
                        principalTable: "SysMenu",
                        principalColumn: "Id");
                });

            migrationBuilder.CreateTable(
                name: "SysOpenJob",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID"),
                    JobId = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "ID"),
                    JobName = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "任务名称"),
                    RunCount = table.Column<int>(type: "int", nullable: false, comment: "任务执行次数"),
                    ErrorCount = table.Column<int>(type: "int", nullable: false, comment: "异常次数"),
                    NextRunTime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "下次执行时间"),
                    LastRunTime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最后一次执行时间"),
                    LastErrorTime = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "最后一次失败时间"),
                    JobType = table.Column<int>(type: "int", nullable: false, comment: "任务执行方式0：本地任务；1：外部接口任务"),
                    JobCall = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "任务地址"),
                    JobCallParams = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "任务参数，JSON格式"),
                    Cron = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "CRON表达式"),
                    Status = table.Column<int>(type: "int", nullable: false, comment: "任务运行状态（0：停止，1：正在运行，2：暂停）"),
                    SysOrgId = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
                    PlantId = table.Column<long>(type: "bigint", nullable: true, comment: "子公司ID"),
                    OldId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老系统ID"),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "租户Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysOpenJob", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SysRoleInfo",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "名称"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "编码"),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
                    RoleGroupCode = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "分组标记"),
                    SysOrgId = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
                    PlantId = table.Column<long>(type: "bigint", nullable: true, comment: "子公司ID"),
                    OldId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老系统ID"),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "租户Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysRoleInfo", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "SysFileMap",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID"),
                    SysFileInfoId = table.Column<long>(type: "bigint", nullable: true, comment: "文件ID"),
                    DataId = table.Column<long>(type: "bigint", nullable: true, comment: "数据ID"),
                    Key = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Key"),
                    SysOrgId = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
                    PlantId = table.Column<long>(type: "bigint", nullable: true, comment: "子公司ID"),
                    OldId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老系统ID"),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "租户Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysFileMap", x => x.Id);
                    table.ForeignKey(
                        name: "FK_SysFileMap_SysFileInfo_SysFileInfoId",
                        column: x => x.SysFileInfoId,
                        principalTable: "SysFileInfo",
                        principalColumn: "Id");
                });

            migrationBuilder.CreateTable(
                name: "SysRoleMenu",
                columns: table => new
                {
                    SysRoleId = table.Column<long>(type: "bigint", nullable: false, comment: "角色Id"),
                    SysMenuId = table.Column<long>(type: "bigint", nullable: false, comment: "菜单Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysRoleMenu", x => new { x.SysRoleId, x.SysMenuId });
                    table.ForeignKey(
                        name: "FK_SysRoleMenu_SysMenu_SysMenuId",
                        column: x => x.SysMenuId,
                        principalTable: "SysMenu",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_SysRoleMenu_SysRoleInfo_SysRoleId",
                        column: x => x.SysRoleId,
                        principalTable: "SysRoleInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateTable(
                name: "SysOrgInfo",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID"),
                    Name = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "组织名称"),
                    Code = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "组织编码"),
                    Level = table.Column<int>(type: "int", nullable: false, comment: "组织等级"),
                    LineNode = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "节点走向"),
                    ParentInfoId = table.Column<long>(type: "bigint", nullable: true, comment: "父级ID"),
                    SysRoleInfoId = table.Column<long>(type: "bigint", nullable: true),
                    SysUserInfoId = table.Column<long>(type: "bigint", nullable: true),
                    SysOrgId = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
                    PlantId = table.Column<long>(type: "bigint", nullable: true, comment: "子公司ID"),
                    OldId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老系统ID"),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "租户Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysOrgInfo", x => x.Id);
                    table.ForeignKey(
                        name: "FK_SysOrgInfo_SysOrgInfo_ParentInfoId",
                        column: x => x.ParentInfoId,
                        principalTable: "SysOrgInfo",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_SysOrgInfo_SysRoleInfo_SysRoleInfoId",
                        column: x => x.SysRoleInfoId,
                        principalTable: "SysRoleInfo",
                        principalColumn: "Id");
                });

            migrationBuilder.CreateTable(
                name: "SysUserInfo",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false, comment: "主键ID"),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "用户名字"),
                    Age = table.Column<int>(type: "int", nullable: true, comment: "用户年龄"),
                    Sex = table.Column<int>(type: "int", nullable: true, comment: "用户年龄"),
                    Account = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "账号"),
                    PassWord = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "密码"),
                    Phone = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "电话"),
                    Email = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "邮箱"),
                    Birthday = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "生日"),
                    PhotoId = table.Column<long>(type: "bigint", nullable: true, comment: "照片"),
                    RandomCode = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "随机码"),
                    Tag = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "标签"),
                    SysOrgId = table.Column<long>(type: "bigint", nullable: true, comment: "组织ID"),
                    PlantId = table.Column<long>(type: "bigint", nullable: true, comment: "子公司ID"),
                    OldId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "老系统ID"),
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true, comment: "租户Id"),
                    CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "创建时间"),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true, comment: "更新时间"),
                    CreatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "创建者Id"),
                    UpdatedUserId = table.Column<long>(type: "bigint", nullable: true, comment: "修改者Id"),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, comment: "软删除")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysUserInfo", x => x.Id);
                    table.ForeignKey(
                        name: "FK_SysUserInfo_SysFileMap_PhotoId",
                        column: x => x.PhotoId,
                        principalTable: "SysFileMap",
                        principalColumn: "Id");
                    table.ForeignKey(
                        name: "FK_SysUserInfo_SysOrgInfo_SysOrgId",
                        column: x => x.SysOrgId,
                        principalTable: "SysOrgInfo",
                        principalColumn: "Id");
                });

            migrationBuilder.CreateTable(
                name: "SysUserRole",
                columns: table => new
                {
                    SysUserId = table.Column<long>(type: "bigint", nullable: false, comment: "系统用户Id"),
                    SysRoleId = table.Column<long>(type: "bigint", nullable: false, comment: "系统角色Id")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SysUserRole", x => new { x.SysUserId, x.SysRoleId });
                    table.ForeignKey(
                        name: "FK_SysUserRole_SysRoleInfo_SysRoleId",
                        column: x => x.SysRoleId,
                        principalTable: "SysRoleInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                    table.ForeignKey(
                        name: "FK_SysUserRole_SysUserInfo_SysUserId",
                        column: x => x.SysUserId,
                        principalTable: "SysUserInfo",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.InsertData(
                table: "SysMenu",
                columns: new[] { "Id", "ActiveMenu", "Affix", "AlwaysShow", "Breadcrumb", "CanTo", "Component", "CreatedTime", "CreatedUserId", "FollowAuth", "Hidden", "Icon", "IsDeleted", "IsParent", "Level", "Name", "NoCache", "NoTagsView", "OldId", "Order", "ParentInfoId", "Path", "PlantId", "Redirect", "SysOrgId", "TenantId", "Title", "UpdatedTime", "UpdatedUserId" },
                values: new object[] { 361843685175365L, null, false, true, true, false, "#", new DateTimeOffset(new DateTime(2023, 1, 30, 10, 46, 9, 466, DateTimeKind.Unspecified).AddTicks(7723), new TimeSpan(0, 8, 0, 0, 0)), 142307070910551L, null, false, "el-icon-s-tools", false, true, 0, "System", false, false, null, 3, null, "/System", null, "/System/SysMenuManager", 142307070910552L, null, "系统管理", null, null });

            migrationBuilder.InsertData(
                table: "SysOrgInfo",
                columns: new[] { "Id", "Code", "CreatedTime", "CreatedUserId", "IsDeleted", "Level", "LineNode", "Name", "OldId", "ParentInfoId", "PlantId", "SysOrgId", "SysRoleInfoId", "SysUserInfoId", "TenantId", "UpdatedTime", "UpdatedUserId" },
                values: new object[] { 142307070910552L, "000000", null, null, false, 1, "|142307070910552", "MainDepartment", null, null, null, null, null, null, null, null, null });

            migrationBuilder.InsertData(
                table: "SysRoleInfo",
                columns: new[] { "Id", "Code", "CreatedTime", "CreatedUserId", "IsDeleted", "Name", "OldId", "PlantId", "Remark", "RoleGroupCode", "Sort", "SysOrgId", "TenantId", "UpdatedTime", "UpdatedUserId" },
                values: new object[] { 367366781984837L, "Admin", new DateTimeOffset(new DateTime(2023, 1, 30, 10, 46, 9, 464, DateTimeKind.Unspecified).AddTicks(7839), new TimeSpan(0, 8, 0, 0, 0)), 142307070910551L, false, "超级管理员", null, null, "拥有所有的权限,无需单独配置菜单！", null, 1, 142307070910552L, null, null, null });

            migrationBuilder.InsertData(
                table: "SysMenu",
                columns: new[] { "Id", "ActiveMenu", "Affix", "AlwaysShow", "Breadcrumb", "CanTo", "Component", "CreatedTime", "CreatedUserId", "FollowAuth", "Hidden", "Icon", "IsDeleted", "IsParent", "Level", "Name", "NoCache", "NoTagsView", "OldId", "Order", "ParentInfoId", "Path", "PlantId", "Redirect", "SysOrgId", "TenantId", "Title", "UpdatedTime", "UpdatedUserId" },
                values: new object[,]
                {
                    { 361844436615237L, null, false, false, true, false, "system/SysMenuManager/Index", new DateTimeOffset(new DateTime(2023, 1, 30, 10, 46, 9, 466, DateTimeKind.Unspecified).AddTicks(7774), new TimeSpan(0, 8, 0, 0, 0)), 142307070910551L, null, false, "el-icon-s-fold", false, null, 1, "SysMenuManager", false, false, null, 0, 361843685175365L, "SysMenuManager", null, null, 142307070910552L, null, "菜单管理", null, null },
                    { 366269923790917L, null, null, false, null, null, "system/SysUserManager/Index", new DateTimeOffset(new DateTime(2023, 1, 30, 10, 46, 9, 466, DateTimeKind.Unspecified).AddTicks(7783), new TimeSpan(0, 8, 0, 0, 0)), 142307070910551L, null, false, "el-icon-user-solid", false, null, 1, "SysUserManager", false, null, null, 0, 361843685175365L, "SysUserManager", null, null, 142307070910552L, null, "用户管理", null, null },
                    { 366358749757509L, null, null, false, null, null, "system/SysOrgInfoManager/Index", new DateTimeOffset(new DateTime(2023, 1, 30, 10, 46, 9, 466, DateTimeKind.Unspecified).AddTicks(7786), new TimeSpan(0, 8, 0, 0, 0)), 142307070910551L, null, false, "el-icon-menu", false, null, 1, "SysOrgInfoManager", false, null, null, 0, 361843685175365L, "SysOrgInfoManager", null, null, 142307070910552L, null, "组织架构", null, null },
                    { 367057077911621L, null, null, false, null, null, "system/SysFileManager/Index", new DateTimeOffset(new DateTime(2023, 1, 30, 10, 46, 9, 466, DateTimeKind.Unspecified).AddTicks(7790), new TimeSpan(0, 8, 0, 0, 0)), 142307070910551L, null, false, "el-icon-folder-opened", false, null, 1, "SysFileManager", false, null, null, 0, 361843685175365L, "SysFileManager", null, null, 142307070910552L, null, "文件管理", null, null },
                    { 367057681936453L, null, null, false, null, null, "system/SysRoleManager/Index", new DateTimeOffset(new DateTime(2023, 1, 30, 10, 46, 9, 466, DateTimeKind.Unspecified).AddTicks(7793), new TimeSpan(0, 8, 0, 0, 0)), 142307070910551L, null, false, "el-icon-user", false, null, 1, "SysRoleManager", false, null, null, 0, 361843685175365L, "SysRoleManager", null, null, 142307070910552L, null, "角色管理", null, null }
                });

            migrationBuilder.InsertData(
                table: "SysUserInfo",
                columns: new[] { "Id", "Account", "Age", "Birthday", "CreatedTime", "CreatedUserId", "Email", "IsDeleted", "OldId", "PassWord", "Phone", "PhotoId", "PlantId", "RandomCode", "Sex", "SysOrgId", "Tag", "TenantId", "UpdatedTime", "UpdatedUserId", "UserName" },
                values: new object[] { 142307070910551L, "Admin", 0, null, null, null, null, false, null, "123456", "", null, null, null, 0, 142307070910552L, null, null, null, null, "Admin" });

            migrationBuilder.InsertData(
                table: "SysUserRole",
                columns: new[] { "SysRoleId", "SysUserId" },
                values: new object[] { 367366781984837L, 142307070910551L });

            migrationBuilder.CreateIndex(
                name: "IX_SysFileMap_SysFileInfoId",
                table: "SysFileMap",
                column: "SysFileInfoId",
                unique: true,
                filter: "[SysFileInfoId] IS NOT NULL");

            migrationBuilder.CreateIndex(
                name: "IX_SysMenu_ParentInfoId",
                table: "SysMenu",
                column: "ParentInfoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysOrgInfo_ParentInfoId",
                table: "SysOrgInfo",
                column: "ParentInfoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysOrgInfo_SysRoleInfoId",
                table: "SysOrgInfo",
                column: "SysRoleInfoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysOrgInfo_SysUserInfoId",
                table: "SysOrgInfo",
                column: "SysUserInfoId");

            migrationBuilder.CreateIndex(
                name: "IX_SysRoleMenu_SysMenuId",
                table: "SysRoleMenu",
                column: "SysMenuId");

            migrationBuilder.CreateIndex(
                name: "IX_SysUserInfo_PhotoId",
                table: "SysUserInfo",
                column: "PhotoId",
                unique: true,
                filter: "[PhotoId] IS NOT NULL");

            migrationBuilder.CreateIndex(
                name: "IX_SysUserInfo_SysOrgId",
                table: "SysUserInfo",
                column: "SysOrgId");

            migrationBuilder.CreateIndex(
                name: "IX_SysUserRole_SysRoleId",
                table: "SysUserRole",
                column: "SysRoleId");

            migrationBuilder.AddForeignKey(
                name: "FK_SysOrgInfo_SysUserInfo_SysUserInfoId",
                table: "SysOrgInfo",
                column: "SysUserInfoId",
                principalTable: "SysUserInfo",
                principalColumn: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_SysFileMap_SysFileInfo_SysFileInfoId",
                table: "SysFileMap");

            migrationBuilder.DropForeignKey(
                name: "FK_SysOrgInfo_SysRoleInfo_SysRoleInfoId",
                table: "SysOrgInfo");

            migrationBuilder.DropForeignKey(
                name: "FK_SysOrgInfo_SysUserInfo_SysUserInfoId",
                table: "SysOrgInfo");

            migrationBuilder.DropTable(
                name: "CustomerInfo");

            migrationBuilder.DropTable(
                name: "SysLogging");

            migrationBuilder.DropTable(
                name: "SysOpenJob");

            migrationBuilder.DropTable(
                name: "SysRoleMenu");

            migrationBuilder.DropTable(
                name: "SysUserRole");

            migrationBuilder.DropTable(
                name: "SysMenu");

            migrationBuilder.DropTable(
                name: "SysFileInfo");

            migrationBuilder.DropTable(
                name: "SysRoleInfo");

            migrationBuilder.DropTable(
                name: "SysUserInfo");

            migrationBuilder.DropTable(
                name: "SysFileMap");

            migrationBuilder.DropTable(
                name: "SysOrgInfo");
        }
    }
}
